﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace ThinhTien.Models
{
    public class CategoryViewModel : BaseViewModel
    {
        [Display(Name = "Parent:")]
        public Nullable<System.Guid> ParentID { get; set; }

        [Display(Name = "Is home page:")]
        public Nullable<bool> IsHomePage { get; set; }

        [Required(ErrorMessage = "Name is required")]
        [Display(Name = "Name:")]
        [StringLength(int.MaxValue, MinimumLength = 1)]
        public string Name { get; set; }

        [Required(ErrorMessage = "Description is required")]
        [Display(Name = "Description:")]
        [StringLength(int.MaxValue, MinimumLength = 1)]
        public string Description { get; set; }

        [Required(ErrorMessage = "Position is required")]
        [Display(Name = "Position:")]
        [RegularExpression("[0-9][0-9]*", ErrorMessage = "Position is invalid")]
        public Nullable<int> Position { get; set; }

        public byte[] Photo { get; set; }
    }
}
